from imports import *
from graphics import *



class Board:
    __slots__=("freeboard", "gridboard")
    
    def __init__(self, map):
        print("init Board")
        self.freeboard = Freeboard(map.gridsize)
        self.gridboard = Gridboard(map.gridsize)
        
        
        
        
    #draws itself then calls draw on its children
    def draw(self):
        self.drawself()
        self.gridboard.draw()
        self.freeboard.draw()
    
    
    def drawself(self):
        g = Graphics()
        g.rect((255, 100, 200), (100, 100, 50, 300))
        
        #draws the board background
    
    
    #returns true if the tower was placed
    def addtower(self, tower):
        return self.gridboard.add(tower)


    #returns the tower that is removed
    def removetower(self, tower):
        return self.gridboard.remove(tower)
        
    
    #adds an entity e to the board, returns true on adding
    def addentity(self, e):
        return self.freeboard.add(pos)
        
    #returns true if removed
    def removeentity(self, e):
        return self.freeboard.remove(pos)

    

